{% include "default/header.html" %}
{% include "default/index_left.html" %}

<div id="content-block" class="col-sm-11 col-md-10">
<table class="table table-bordered">
    <pre>未安装系统服务器列表</pre>
	<thead>
		<tr>
			<th width="60">
				<input id="checkAll" type="checkbox">
			</th>
			<th>
				主机名
			</th>
            <th>
				状态
			</th>

		</tr>
	</thead>
    <form id="changelist-form" method="POST" action="/auto/install/">{% csrf_token %}
    {% for i in list %}
	<tbody>
		<tr >
            <td>
                <label for="checkbox-inline"><input id="id_business_{{ i.id }}" type="checkbox" name="hostname_id" value="{{ i.id }}"></label>
            </td>
			<td width="200">
				<a href="/assets/server/node_id/{{ i.id }}/" >{{ i.node_name }}</a>
			</td>

			<td>
				{{ i.usage }}
			</td>
            <td width="50">
				<button class="btn btn-xs btn-primary" data-toggle="modal">安装系统</button>
			</td>
		</tr>
	</tbody>
    {% endfor %}
</table>

                 <button type="submit" class="btn btn-success btn-sm">批量初始化</button>

</form>

</div>

{#{{ uf }}#}
{% include 'default/footer.html' %}

{#<script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript"></script>#}

<script type="text/javascript">
    $(function() {
       $("#checkAll").click(function() {
            $('input[name="hostname_id"]').attr("checked",this.checked);
        });
        var $subBox = $("input[name='hostname_id']");
        $subBox.click(function(){
            $("#checkAll").attr("checked",$subBox.length == $("input[name='hostname_id']:checked").length ? true : false);
        });
    });
</script>



